window._STEAM = {

    electron:null,

    sence:null,

    _pre:'_steam_',

    init:function(){
        _STEAM.electron = globalThis.electronAPI
        
        if (_STEAM.electron) {
            // 调用自定义electron接口，并传入回调函数
            _STEAM.electron.loginCallback((event, msg) => {

                console.log(" 登录： " , msg);

                _HQM._USERNAME = _STEAM._pre+msg.accountId;

                if(_STEAM.sence=='saveData'){
                    _MSD.refreshUiCommon();
                }else if(_STEAM.sence=="bycode"){
                    //_CHESSJFUI.refreshHome();
                    _HTTP.getJf();
                }else{
                    _HTTP.getJf();
                }

            })
        }
    },

    login:function(sence){
        _STEAM.sence = sence;
        if (!_STEAM.electron) {
            return
        } else{
            _STEAM.electron.login(false);
        }
    }


}